<?php

Route::group(['prefix' => 'admin', 'namespace' => 'Backend'], function () {
    /*
    |--------------------------------------------------------------------------
    | 未登录
    |--------------------------------------------------------------------------
    |
    | 不需要登录可以访问的路由
    |
    */
    Route::get('login', 'AuthController@getLogin');
    Route::get('logout', 'AuthController@getLogout');
    Route::post('login', 'AuthController@authenticate');

    /*
    |--------------------------------------------------------------------------
    | 已登录
    |--------------------------------------------------------------------------
    |
    | 即是需要登录才可以访问的路由
    |
    */
    Route::group(['middleware' => 'auth',], function() {
        Route::get('dashboard', 'DashboardController@index');
        
        Route::resource('hrs', 'HrController');
        Route::resource('companys', 'CompanyController');
        Route::resource('admins', 'AdminController');
        Route::resource('permissions', 'PermissionController');
        Route::resource('permission_groups', 'PermissionGroupController');
        Route::resource('roles', 'RoleController');
        Route::resource('resumes', 'ResumeController', ['except' => ['create', 'store']]);
        
        // 
        Route::group(['prefix' => 'analytics'], function() {
            Route::get('site', 'AnalyticController@site');
            Route::get('visitor_statistics', 'AnalyticController@visitorStatistics');
            Route::get('pv_statistics', 'AnalyticController@pvStatistics');
        });
    });
    
});
